package com.dc.project.entity.bo;

import com.dc.project.entity.po.TemplateDetailAttachment;
import com.own.component.common.base.entity.BaseBo;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * TemplateDetailAttachmentBo
 *
 * @author chenxueli
 * @date 2025-03-19 13:23:08
 */
@Schema(title = "模板详情附件" + ConstantBeanSuffix.BO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class TemplateDetailAttachmentBo extends BaseBo<TemplateDetailAttachment> implements Serializable {

    /**
     * 模板详情id
     */
    private Long templateDetailId;

    /**
     * 附件id
     */
    private Long attachmentId;

    /**
     * 附件名称
     */
    private String attachmentName;

    /**
     * 附件路径
     */
    private String attachmentPath;

    /**
     * 附件提示语
     */
    private String attachmentPrompt;

    /**
     * 转持久化对象
     *
     * @param entity 原持久化对象
     * @return 持久化对象
     */
    @Override
    public TemplateDetailAttachment toPo(TemplateDetailAttachment entity) {
        if (entity == null) {
            entity = new TemplateDetailAttachment();
        }
        entity.setFkTemplateDetailId(this.templateDetailId);
        entity.setFkAttachmentId(this.attachmentId);
        entity.setAttachmentName(this.attachmentName);
        entity.setAttachmentPath(this.attachmentPath);
        entity.setAttachmentPrompt(this.attachmentPrompt);
        return super.toPo(entity);
    }

}

